<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>

  <TITLE>CS631 -- Advanced Programming in the UNIX Environment</TITLE>
  <STYLE type="text/css">
  body {
  background-color: #FFFFFf;
  }
  </STYLE>
  <STYLE type="text/css">
  li.c1 {list-style: none}
  </STYLE>

</HEAD>

<BODY>
  <TABLE border="1" align="center" cellpadding="15">
    <TR>
      <TD valign="top">
        <H2>CS631 -- Advanced Programming in the UNIX Environment - Fall 2011 - HW#4</H2>

        <H3>HW#4: fill in SWS framework</H3>

        <H4>Summary</H4>
	<p>The objective of this assignment is for you to write the main
	framework of your <a href="f11-final-project.html">final project</a>.
	Since the actual functionality of the final project will be
	implemented in a shared library, you can already build your main
	program using the (currently) known API defined in <a
        href="final/sws.h">sws.h</a> and link against the stub
	library provided to you <a href="final/">here</a>.
	</p>
	</p>
	<h4>Problem assignment</h4>
	<p>Download all files in <a href="final/">this directory</a>.
	Edit the file <tt>main.c</tt> to implement all noted
	functionality.  That is, parse all given command-line options,
	d&aelig;monize if appropriate (ie not in debugging mode),
	call <tt>sws_init</tt>, and enter the main loop:
	<ul>
	  <li>initialize a socket to listen on the desired network
	    address(es) and port</li>
	  <li>listen on the socket</li>
	  <li>forever loop, <tt>accept</tt>ing or <tt>select</tt>ing
	    connections</li>
	  <li>fork a new process for each new connection</li>
	  <li>call <tt>sws_request</tt>, passing it the socket to process
	    the request</li>
	  <li>close the socket and exit the child</li>
	</ul>
	</p>
	<h4>Deliverables and Due Date</H4>
	<p>You will submit the single file <tt>main.c</tt>.</p>
        <p>
        The due date for this assignment is 2011-11-14 18:15.  Please
        attach the file to an email sent from your <tt>@stevens.edu</tt>
        email address to <a
        href="mailto:jschauma@stevens.edu?subject=[CS631] HW4">jschauma@stevens.edu</a>
        with a subject of "[CS631] HW4".
        </p>
        <hr>
        [<a href="index.html">Course Website</a>]
</BODY>
</HTML>
